package uz.edo.app.client;
//import java.sql.SQLException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.wicket.markup.html.WebPage;

public class SignOut extends WebPage
{
    private static Log _log = LogFactory.getLog(SignOut.class);
    public SignOut()
    {
        setRedirect(true);
        if(getSession() != null && !getSession().isSessionInvalidated())
        {
        	/*
            SqlMapClient sqlMap = SqlMapHelper.getSqlMap();
            if(((MySession)getSession()).getUser() != null)
            {
                try
                {
                    UserSession us = new UserSession();
                    us.setUser_id(((MySession)getSession()).getUser().getUser_id());
                    sqlMap.delete("removeUserSession", us);
                }
                catch(SQLException sqle)
                {
                    _log.error(sqle);
                }
                if(_log.isDebugEnabled())
                {
                    _log.debug(((MySession)getSession()).getUser().getUser_login() + " signed out");
                }
            }
            */
            getSession().invalidate();
        }
        setResponsePage(Login.class);
    }
}